import request from '@/utils/request'
export function getCKDlist(data) {
  return request({
    url: '/chukud/queryChukudAsPage',
    method: 'post',
    data,
  })
}
export function getCKDone(data) {
  return request({
    url: '/chukud/getChukudByID',
    headers: { 'content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}
export function updateChukudStatus(data) {
  return request({
    url: '/chukud/updateZhuangtai',
    headers: { 'content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

export function QueryKufangList(data) {
  return request({
    url: '/kufang/query',
    method: 'post',
    data,
  })
}
export function insertchukud(data) {
  return request({
    url: '/chukud/add',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function updatechukud(data) {
  return request({
    url: '/chukud/update',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function ScJhd(data) {
  return request({
    url: '/chukud/shengChengJianHuoDList',
    method: 'post',
    data,
  })
}
export function DelCKD(data) {
  return request({
    url: `/chukud/delete`,
    headers: { 'content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}
export function getJHDlist(data) {
  return request({
    url: 'chukurwd/queryChukurwdAsPage',
    method: 'post',
    data,
  })
}
export function uploadJhd(data) {
  return request({
    url: '/jianhuod/jianhuoqr',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}

export function getJHDOne(data) {
  return request({
    url: '/chukurwd/getChukurwdByID',
    headers: { 'content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}
//取消出库任务
export function delJHD(data) {
  return request({
    url: '/jianhuod/quxiaorw',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//删除出库任务
export function delJHDByID(data) {
  return request({
    url: '/chukurwd/delete',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}//新增出库任务
export function insertchukurwd(data) {
  return request({
    url: '/chukurwd/add',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//新增出库任务
export function updatechukurwd(data) {
  return request({
    url: '/chukurwd/update',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//获取库存明细(通过物资id)
export function getckwzlist(data) {
  return request({
    url: '/kucunmx/queryKucunGroupbyWuziid',
    method: 'post',
    data
  })
}
//获取库存明细(所有)
export function getckwzpage(data) {
  return request({
    url: '/kucunmx/queryKucunmxPage',
    method: 'post',
    data
  })
}
//获取库存明细
export function queryKcmx(data, wuzidata) {
  return request({
    url: `/kucunmx/queryKucunmx?wuziids=${wuzidata.wuziids}`,
    method: 'post',
    // headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//生成出库任务
export function ScJhdlist(url, data) {
  return request({
    // url: '/jianhuod/insertJianhuodFromChukud',
    url: `/jianhuod/insertJianhuodMapList?chukudid=${url.chukudid}&chukudmxid=${url.chukudmxid}&yifenpeisl=${url.yifenpeisl}`,
    method: 'post',
    data
  })
}
//更新出库任务单状态

export function updateCkrwdState(data) {
  return request({
    url: '/chukurwd/updateZhuangtai',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
// 出库调拨单
export function QueryChukudbdPage(data) {
  return request({
    url: '/chukudbd/queryPage',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
export function GetChukudbdPageByid(data) {
  return request({
    url: '/chukudbd/get',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
export function DelChukudbd(data) {
  return request({
    url: '/chukudbd/delete',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
export function SaveChukudbd(data) {
  return request({
    url: '/chukudbd/save',
    method: 'post',
    data
  })
}
// 上传出库调拨文件
export function insertDbdFile(data) {
  return request({
    url: '/chukudbd/insertChukudbdFile',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
export function deleteFileByPara(data) {//删除调拨单文件
  return request({
    url: '/chukudbd/deleteFileByPara',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function downloadFileByPath(data) {//下载调拨单文件
  return request({
    url: '/chukudbd/downloadFileByPath',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
export function queryFileListByPara(data) {//调拨单文件列表
  return request({
    url: '/chukudbd/queryFileListByPara',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
// 上传出库调拨明细
export function inportCkdbdMx(data) {
  return request({
    url: '/chukudbd/importChukudbd',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//调拨单审核
export function CkdbdSh(data) {
  return request({
    url: '/chukudbd/chukudbdsh',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//调拨单分发
export function CkdbdFf(data) {
  return request({
    url: '/chukudbd/fenfa',
    method: 'post',
    data
  })
}
//调拨单分发库存
export function Ckdbdfkcmx(data) {
  return request({
    url: '/kucunhz/queryKucunhzByPara',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//拣货确认
export function saveJhdqr(data) {
  return request({
    url: '/jianhuod/jianhuoqr',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//调拨单添加物资
export function dbdaddwuzilist(data) {
  return request({
    url: '/kucunhz/queryPage',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//下发任务wcs
export function downRWone(data) {
  return request({
    url: '/wcsgl/sendChukurwd',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data
  })
}
//重置任务
export function resetTask(data) {
  return request({
    url: '/wcsgl/chukurenwdSuccess',
    method: 'post',
    headers: { 'content-Type': 'multipart/form-data' },
    data,
  })
}
